Skip to content

[KDM-TEST-FIX-417] Fix multi-agent council timeouts and fallback - #417

Merged
utkarsh232005 merged 6 commits into
KDM-cli:mainfrom
utkarsh232005:fix/383-council-timeout
Nov 13, 2026
Merged

utkarsh232005 merged 6 commits into
KDM-cli:mainfrom
utkarsh232005:fix/383-council-timeout

Conversation

@utkarsh232005

Copy link
Copy Markdown
Member

Fixes #383.\n\n- Increase the default council watchdog to 120 seconds and support KDM_COUNCIL_TIMEOUT_MS plus --council-timeout.\n- Probe Python and Ollama before launching the council.\n- Preserve useful per-workload diagnostics through rule, cloud, or raw-summary fallback when council execution is unavailable.\n- Ensure dashboard status reflects detected errors.\n- Remove duplicate analysis option declarations introduced during the v4.0.0 merge.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 17:52
@github-actions github-actions Bot changed the title Fix multi-agent council timeouts and fallback [KDM-CLI-FIX-417] Fix multi-agent council timeouts and fallback Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

Parsing errors: 2

Validation error: Invalid input: expected string, received undefined at "reviews.path_instructions[3].path"; Invalid input: expected string, received undefined at "reviews.path_instructions[3].instructions"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Summary

Summary by CodeRabbit

  • New Features
    • Multi-agent analysis now supports a configurable council timeout. Set it with --council-timeout; the default is two minutes.
  • Bug Fixes
    • Analysis now prioritizes results with errors and provides fallback explanations when council analysis fails.
    • Dashboard status now reports problems when problem items are present, even if the overall result status is OK.

The analyze command now accepts a configurable council timeout. Council execution checks dependencies and uses per-result fallback handling when execution fails. The dashboard OK status uses both problem count and result status. Safety prompt options now include an interactive setting.

Changes: Council timeout and failure handling

Layer / File(s) Summary
Timeout configuration and resolution
src/analysis/types.ts, src/commands/analyze.ts, src/analysis/analysis.ts, src/agent/python-bridge.ts
The analyze command validates --council-timeout as a positive safe integer and passes it through analysis options. The bridge resolves the per-call value, KDM_COUNCIL_TIMEOUT_MS, or the 120,000 ms default.
Council execution and fallback details
src/analysis/analysis.ts, src/analysis/__tests__/analysis-baseline.test.ts, src/__tests__/cli-flags.test.ts, src/__tests__/e2e-system.test.ts, src/ui/AnalyzeDashboard.tsx
Council execution checks dependencies and passes the configured timeout to the bridge. It selects a result with errors when available and applies rule-engine, legacy-AI, then raw-summary fallbacks after failure. The dashboard reports OK only when there are no problem items and the status is not ProblemDetected. Related tests mock council dependencies and verify council diagnosis details.

Interactive prompt and UI options

Layer / File(s) Summary
Interactive options and test rendering
src/remediation/safety-prompt.ts, src/__tests__/safety-prompt.test.ts, src/__tests__/analyze-dashboard-events.test.tsx
PromptSafetyOptions adds an optional interactive value, which resolveIOOptions returns. Ink tests set interactive mode explicitly, except the null-tool case, which sets it to false.

Estimated code review effort: 4 (Complex) | ~40 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant executeCouncilForResults
  participant checkCouncilDependencies
  participant runAgentCouncilProcess
  participant RuleEngine
  participant LegacyAI
  participant RawSummary
  executeCouncilForResults->>checkCouncilDependencies: check council availability
  executeCouncilForResults->>runAgentCouncilProcess: run council with configured timeout
  alt Council returns successfully
    runAgentCouncilProcess-->>executeCouncilForResults: return consensus
  else Dependency check or council execution fails
    executeCouncilForResults->>RuleEngine: apply fallback to results with errors
    executeCouncilForResults->>LegacyAI: use when the rule engine does not apply
    executeCouncilForResults->>RawSummary: use when legacy AI returns no response
  end
Loading
Merge Risk: Moderate · up to 33053

Pressing Ctrl+C during a multi-agent council run can still start fallback work, including external AI requests, and delay exit. A stalled Python import check can also block analysis indefinitely before the council timeout applies. Both should be fixed before merging; the failures are bounded and have simple fixes.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions github-actions Bot changed the title [KDM-CLI-FIX-417] Fix multi-agent council timeouts and fallback [KDM-TEST-FIX-417] Fix multi-agent council timeouts and fallback Nov 13, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Improved (1 files improve in Code Health)

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
analysis.ts 8.31 → 8.82 Overall Code Complexity

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.50000% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/analysis/analysis.ts 77.77% 1 Missing and 5 partials ⚠️
src/commands/analyze.ts 20.00% 4 Missing ⚠️
src/agent/python-bridge.ts 83.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@utkarsh232005
utkarsh232005 merged commit b0fa547 into KDM-cli:main Nov 13, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(multi-agent): Python agent council subprocess times out (45s) for large local models — missing per-result invocation & timeout scaling

2 participants